<html>

	<head>
		<title></title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">

		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>

		<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
		<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js" type="text/javascript"></script>

		<script type="text/javascript">
			var manager;
			$(document).hover(parent.hindMenu);
			var typeUrl = BaseUrl + "ProductTypeSql?token=" + $api.getStorage("token");
			$(function() {
				var url = typeUrl + "&key=";
				manager = $("#maingrid4").ligerGrid({
					columns: [{
							display: '编号',
							name: 'Fid',
							width: 80
						},
						{
							display: '名称',
							name: 'Fname',
							width: 300,
							align: 'left',
							render: function(rowdata, rowindex, value) {
								if(rowdata.TLevel == 0) {
									return "<div style='display:inline-block;'><span class='folder-open'></span>" + rowdata.Fname + "</div>";
								}
								var mleft = 15 * rowdata.Flevel + "px";
								if(rowdata.Flevel > 1)
									mleft = 15 * rowdata.Flevel + 25 * (rowdata.Flevel - 1) + "px";

								return "<div style='display:inline-block;margin-left:" + mleft + ";'><span class='folder-line'></span><span class='folder-open'></span>" + rowdata.Fname + "</div>";
							}
						},
						{
							display: '创建时间',
							name: 'Fdate',
							minWidth: 300,
							type: 'date'
						}
					],
					dataAction: 'local',
					url: url,
					checkbox:true,
					method:'get',
					 rowHeight :"33px",
					width: '100%',
					height: '88%',
					pageSize: 50,
					usePager: true
				});
			});

			function doserch() {
				var key = $("#txtKeywords").val();

				var url = typeUrl + "&key=" + key;
				manager.GetDataByURL(url);
			}

			function getRow() {
				var rows = manager.getSelectedRows();
				if(rows) {
					
					var ids="";
					var iFname = "";
					var isExists = false;
					rows.map(function(item){
						if(item.Flevel==0 )isExists=true;
							
						ids+=item.Fid+",";
						iFname+=item.Fname+",";
					})
					if(isExists&&rows.length>1){
							$.ligerDialog.warn('顶级目录不能多选');
							return null;
					}
					var row={
						"Fid":ids.substr(0,ids.length-1),
						"Fname":iFname.substr(0,iFname.length-1)
					};
					return row;
				}
				return null;
			}
		</script>

	</head>

	<body class="mainbody">
		<form id="form1" onsubmit="return false">
			<div class="toolbar-wrap">
				<div  class="toolbar">
					<div class="l-list">
						<ul id="icon-list" class="icon-list">
							<li><span style="font-size:12px">
								注：如无分类则请再自定义分类管理中添加,<span style="color:red;">父分类仅允许选择一个,最子级允许多选</span></span></li>
						</ul>
					</div>
					<div class="r-list">
						<input type=text ID="txtKeywords" class="keyword" />
						<a class='btn-search' href='#' onclick='doserch();'></a>
					</div>
				</div>
			</div>
			<div id="maingrid4" style="margin: 0px;background:#fff;"></div>

		</form>

	</body>

</html>